import { AuthUtil } from '@/utils'

// 所有插件必须导出一个install 方法
export const install = app => {
	app.directive('auth', {
		mounted(el, binding) {
			const { value } = binding
			if (value && !AuthUtil.hasPermission(value)) {
				el.parentNode && el.parentNode.removeChild(el)
			}
		},
	})
}
